<?php
/**
 * Created by PhpStorm.
 * User: stupboy
 * Date: 2018/6/6
 * Time: 0:09
 * Mail:87658989@qq.com
 */

namespace app\mobile\controller;

use think\Db;

class Answer
{
    public function index(){
        $where['id'] = ['gt',60];
        $list = Db::name('gallery_answer')->where($where)->select();
        $class = [
            5=>'五年级',
            6=>'六年级',
            7=>'七年级',
            8=>'八年级',
            9=>'九年级',
            10=>'高一',
            11=>'高二',
        ];
        foreach ($list as $k=>$value){
            $arr = unserialize($value['content']);
            echo ($k + 1 ).'.'. $arr[0]['content'].' , ' . $arr[1]['content'] .' , '. $class[$arr[2]['content']];
            echo '<br>';
        }
    }
}